﻿using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using BIS.Portal.Modules.CMS.Entity;
using BIS.Utility.DAL;
using BIS.Utility.DAL.DataMapper;

namespace BIS.Portal.Modules.CMS.DAL
{
    public class ClientCmsMenuDAL
    {
        /// <summary>
        /// Lấy dữ liệu trong bảng BIS_CMS_Category dùng cho menu
        /// </summary>
        /// <returns></returns>
        public static IList<ClientCmsMenuEnity> GetCategoriesForMenu(int iLanguage_in_use_id)
        {
            IList<ClientCmsMenuEnity> list;
            using (IDataReader reader = SqlHelper.ExecuteReader(DALConnection.ConnectionString,
                                        CommandType.StoredProcedure,
                                        "BIS_sCMS_CATEGORY_GetCategoriesForMenu", new SqlParameter("@language_in_use_id", iLanguage_in_use_id)))
            {
                list = EntityMapper.FillCollection<ClientCmsMenuEnity>(reader);
            }

            return list;
        }

    }
}
